Adaptive ray tracing suitable for shadow rendering

ABSTRACT

In examples, the number of rays used to sample lighting conditions of a light source in a virtual environment with respect to particular locations in the virtual environment may be adapted to scene conditions. An additional ray(s) may be used for locations that tend to be associated with visual artifacts in rendered images. A determination may be made on whether to cast an additional ray(s) to a light source for a location and/or a quantity of rays to cast. To make the determination variables such as visibilities and/or hit distances of ray-traced samples of the light source may be analyzed for related locations in the virtual environment, such as those in a region around the location (e.g., within an N-by-N kernel centered at the location). Factors may include variability in visibilities and/or hit distances, differences between visibilities and/or hit distances relative to the location, and magnitudes of hit distances.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.62/820,214 titled “Adaptive Ray Tracing for Shadow Rendering,” filed onMar. 18, 2019 and this application is a continuation of U.S. patentapplication Ser. No. 16/822,899, titled “Adaptive Ray Tracing SuitableFor Shadow Rendering,” filed Mar. 18, 2020. Each of these applicationsis incorporated herein by reference in its entirety.

BACKGROUND

Ray tracing may be used to render images by tracing a path of light in avirtual environment and simulating the effects of the light'sinteractions with virtual objects, Ray tracing technology may be used tosimulate a variety of optical effects such as shadows, reflections andrefractions, scattering phenomenon, and dispersion phenomenon (such aschromatic aberration). With respect to rendering soft shadows using raytracing, conventional approaches may cast shadow rays from a location ina virtual environment to sample lighting conditions for a pixel withrespect to a light source. The samples of the lighting conditions may becombined and applied to the pixel. In a penumbra (a region of a shadowwhere light is partially occluded) some of the shadow rays may bevisible to the light source and others may be occluded. A large numberof shadow rays may be needed in order for the combined lightingconditions to converge to an accurate result. To conserve computingresources and rendering times, the shadow rays may be sparsely sampled,resulting in a noisy render. The noisy render may be filtered usingdenoising techniques to reduce noise and produce a final render thatmore closely approximates a render of a fully-sampled scene.

However, even with advanced shadow denoising techniques, visualartifacts may still be present in renders due to the sparse sampling ofshadow rays. For example, aliasing may be present in high frequencyareas of an image that include sharp or fine details. Examples includeshadow regions resulting from fine grating, bicycle spokes, densefoliage, blades of grass, leaves, and the like. Avoiding or minimizingthese artifacts typically requires increasing the number of samples usedfor each pixel, which increases the computational resources used forrendering the virtual environment.

SUMMARY

Embodiments of the present disclosure relate to adaptive ray tracingsuitable for shadow rendering. In particular, the present disclosurerelates, in part, to approaches for adapting the number of rays used tosample lighting conditions of a light source in a virtual environment toscene conditions. In contrast to conventional approaches which use thesame number of rays for each location in a virtual environment to samplethat location's lighting conditions with respect to a light source, morerays may be used for some locations in the virtual environment than forother locations. For example, one or more additional rays may be usedfor locations that tend to be associated with visual artifacts inrendered images. Using disclosed approaches, the overall number of raysneeded to render high quality shadows may be reduced, thereby conservingcomputing resources and reducing rendering times.

In accordance with aspects of the disclosure, a determination may bemade on whether to cast at least one additional ray to a light source tosample lighting conditions for a location (e.g., a pixel in world space)in a virtual environment and/or a quantity of rays to cast to the lightsource to sample lighting conditions for the location. To do so,variables such as visibilities and/or hit distances of ray-tracedsamples of the light source may be analyzed for related locations (andthe location in some embodiments) in the virtual environment. In variousembodiments, visibilities and/or hit distances for locations in a regionaround the location may be analyzed (e.g., within an N-by-N kernelcentered at the location) to make the determination(s). Examples offactors used to make the determination(s) include those based on thevariability in the visibilities and/or hit distances within the region.Additional examples of factors include those based on differencesbetween one or more of the visibilities and/or hit distances relative tothe location and/or the overall region. Further examples of factorsinclude those based on the magnitude of one or more of the hit distances(and/or visibilities in some embodiments).

BRIEF DESCRIPTION OF THE DRAWINGS

The present systems and methods for adaptive ray tracing suitable forshadow rendering are described in detail below with reference to theattached drawing figures, wherein:

FIG. 1 is an example system diagram of an adaptive ray tracing system,in accordance with some embodiments of the present disclosure;

FIG. 2A is a diagram illustrating an example of ray-traced samples for aregion in a virtual environment that has full visibility with respect toa light source, in accordance with some embodiments of the presentdisclosure;

FIG. 2B is a diagram illustrating an example of ray-traced samples for aregion in a virtual environment that has no visibility with respect to alight source, in accordance with some embodiments of the presentdisclosure;

FIG. 2C is a diagram illustrating an example of ray-traced samples for aregion in a virtual environment that has mixed visibility and high hitdistances with respect to a light source, in accordance with someembodiments of the present disclosure;

FIG. 2D is a diagram illustrating an example of ray-traced samples for aregion in a virtual environment that has mixed visibility and includeslow hit distances with respect to a light source, in accordance withsome embodiments of the present disclosure;

FIG. 3 is a flow diagram showing an example of a method for determiningwhether to cast one or more additional rays to cast to sample lightingconditions for a pixel, in accordance with some embodiments of thepresent disclosure;

FIG. 4 is a flow diagram showing an example of a method for determininga quantity of rays to cast to sample lighting conditions for a locationin a virtual environment, in accordance with some embodiments of thepresent disclosure;

FIG. 5 is a flow diagram showing an example of a method for determiningwhether to cast one or more additional rays to sample lightingconditions for a location in a virtual environment, in accordance withsome embodiments of the present disclosure;

FIG. 6 is a flow diagram showing an example of a method including adecision tree for determining a quantity of rays cast to sample lightingconditions for a location in a virtual environment, in accordance withsome embodiments of the present disclosure; and

FIG. 7 is a block diagram of an example computing environment suitablefor use in implementing some embodiments of the present disclosure.

DETAILED DESCRIPTION

The present disclosure relates to approaches for adaptive ray tracingsuitable for shadow rendering. More specifically, the present disclosurerelates to approaches for adapting the number of rays used to sample oneor more aspects of a virtual environment (such as lighting conditionswith respect to a light source) to scene conditions. Many ray tracingtechniques—such as stochastic ray tracing techniques—sparsely sampleaspects of a virtual environment with respect to locations within thevirtual environment in order to conserve computational resources. Thiscan result in noisy ray-tracing samples that manifest as visualartifacts in rendered images.

In accordance with aspects of the present disclosure, more rays andcorresponding ray-traced samples may be used for some locations in thevirtual environment (also referred to as a scene) than for otherlocations. For example, one or more additional rays may be used forlocations that tend to be associated with visual artifacts in renderedimages. The additional ray-traced sample(s) at a location(s) may providemore information regarding the one or more aspects of the virtualenvironment with respect to the location(s). Thus, the sampling may beless sparse for that location(s), thereby reducing the likelihood and/orappearance of visual artifacts. Using disclosed approaches, the overallnumber of rays needed to render high quality ray tracing effects may bereduced by adapting the number of rays used for particular locations inthe virtual environment, thereby conserving computing resources andreducing rendering times.

The disclosure focuses on shadow rendering as an example of a suitableray tracing effect which may benefit from disclosed techniques. However,disclosed techniques may be used for any of a variety of ray tracingeffects, such as reflections, global illuminations, and the like. Inaccordance with aspects of the disclosure, a determination may be madeon whether to cast at least one additional ray to a light source tosample lighting conditions for a location (e.g., a pixel in world space)in a virtual environment and/or a quantity of rays to cast to the lightsource to sample lighting conditions for the location. Lightingconditions, as used herein, may refer to an aspect of a virtualenvironment that represents lighting, such as radiance, irradiance, asolution or portion of a solution to the rendering equation (eitherbiased or unbiased), etc. To do so, variables such as visibilitiesand/or hit distances of ray-traced samples of the light source may beanalyzed for related locations (and the location in some embodiments) inthe virtual environment. Where a variable relates to lighting conditionsit may also be referred to herein as a lighting parameter. For example,a lighting parameter may refer to one or more variables that may be usedto compute lighting conditions.

In various embodiments, visibilities and/or hit distances for locationsmay be analyzed to make the determination(s). The locations may bedetermined based on proximities with respect to a given location. Forexample, locations within a threshold distance from the given locationmay be analyzed. In some embodiments, the locations may form a regionsurrounding the given location. For example, the region may be definedas an N-by-N kernel centered at the given location. Examples of factorsused to make the determination(s) include those based on the variabilityin the visibilities and/or hit distances within the region. Additionalexamples of factors include those based on differences between one ormore of the visibilities and/or hit distances relative to the locationand/or the overall region. Further examples of factors include thosebased on the magnitude of one or more of the hit distances (and/orvisibilities in some embodiments).

In at least one embodiment, the ray-traced samples may be generatedusing a ray tracing pass (e.g., one shadow ray per pixel). If thevisibilities for a region meet certain criteria (e.g., have at least athreshold amount of variability), in a subsequent ray tracing pass atleast a first additional ray (e.g., one additional shadow ray) may becast to sample the light source for the location associated with theregion. The visibility criteria may, for example, be used to focus onproducing additional ray-traced samples for locations where some shadowrays may be visible to a light source and others may be occluded, whichmay introduce the potential for noise.

The hit distances may also be analyzed to determine whether to also castin the subsequent ray tracing pass at least a second additional ray(e.g., one additional shadow ray) to sample the light source for thelocation. In some embodiments, if the visibilities do not meet thecriteria, no additional rays may be cast in the subsequent ray tracingpass to sample the light source for the location (e.g., regardless ofthe hit distances). In some examples, criteria for the analysis of thehit distances may be based on the hit distances being below a thresholdvalue, and/or based on one or more of the hit distances being within athreshold of a hit distance of the location. The hit distance criteriamay, for example, be used to focus on producing additional ray-tracedsamples for locations that correspond to high frequency areas of animage that include sharp or fine details, such as locations close to anoccluder. These and other variations may be used depending upon variousfactors, such as the types of visual artifacts being addressed, renderresolution, computational budgets, and the like.

With reference to FIG. 1, FIG. 1 is an example system diagram of anadaptive ray tracing system 100, in accordance with some embodiments ofthe present disclosure. It should be understood that this and otherarrangements described herein are set forth only as examples. Otherarrangements and elements (e.g., machines, interfaces, functions,orders, groupings of functions, etc.) may be used in addition to orinstead of those shown, and some elements may be omitted altogether.Further, many of the elements described herein are functional entitiesthat may be implemented as discrete or distributed components or inconjunction with other components, and in any suitable combination,arrangement, or location. Various functions described herein as beingperformed by entities may be carried out by hardware, firmware, and/orsoftware. For instance, various functions may be carried out by aprocessor executing instructions stored in memory.

The adaptive ray tracing system 100 may include, among other things, animage renderer 102, a ray tracer 104, a sample analyzer 106, and acasting determiner 108. The image renderer 102 may be configured torender images of virtual environments, such as a virtual environment110. To render an image of a virtual environment, the image renderer 102may employ the ray tracer 104, the sample analyzer 106, and the castingdeterminer 108.

The ray tracer 104 may be configured to trace rays through a virtualenvironment using any of a variety of potential ray tracing techniquesin order to generate ray-traced samples of one or more aspects of thevirtual environment (e.g., lighting conditions) with respect tolocations in the virtual environment. The sample analyzer 106 may beconfigured to analyze one or more of the ray-traced samples. The castingdeterminer 108 may determine for a given location(s) whether to cast oneor more additional rays to sample the one or more aspects of the virtualenvironment (e.g., lighting conditions) and/or how many rays to cast tosample the one or more aspects of the virtual environment for the givenlocation(s). The determinations made by the casting determiner 108 maybe based on the results of analysis performed by the sample analyzer106. The ray tracer 104 may cast one or more additional rays accordingto the determinations made by the casting determiner 108, and the imagerenderer 102 may render an image using lighting conditions derived usingsamples from the one or more additional rays. The adaptive ray tracingsystem 100 may include other components that are used to render theimage, such as one or more denoisers.

The image renderer 102 may render an image using any number of raytracing passes in order to sample conditions of a virtual environment.In the example shown, to render an image of the virtual environment 110,the image renderer 102 may employ the ray tracer 104 for at least tworay tracing passes. For example, FIG. 1 illustrates aspects of a raytracing pass 114 and a ray tracing pass 116. Although the ray tracingpass 114 may immediately follow the ray tracing pass 116, in someembodiments one or more intervening ray tracing passes may be performed.Further, in some embodiments, one or more aspects of the presentdisclosure described with respect to the ray tracing pass 114 and theray tracing pass 116 may be accomplished in a single ray tracing pass.

As described herein, the ray tracer 104 may be configured to trace raysthrough a virtual environment using any of a variety of potential raytracing techniques in order to generate ray-traced samples of one ormore aspects of the virtual environment (e.g., lighting conditions) withrespect to locations in the virtual environment. Various examples ofsuch rays are illustrated in FIG. 1 with respect to the ray tracing pass114 and the ray tracing pass 116. For example, a ray 140, a ray 142, anda ray 144 are individually labeled amongst the nine rays shown for theray tracing pass 114 and a ray 146, a ray 148, a ray 150, and a ray 152are individually labeled amongst the seven rays shown for the raytracing pass 116.

The ray tracer 104 may use the rays of the ray tracing pass 114 and theray tracing pass 116 to collectively sample one or more aspects of thevirtual environment with respect to locations in the virtual environment110. Examples of nine locations are shown (of potentially many more), ofwhich locations 130, 132, and 134 are individually labeled. In at leastone embodiment, each ray is associated with one of the locations (e.g.,is cast from the location) and is used to generate a ray-traced samplefor the location. For example, the ray 140 is associated with thelocation 132, the ray 142 is associated with the location 130, and theray 144 is associated with the location 134.

In some embodiments, each location from which the ray tracer 104 casts aray corresponds to a respective pixel. For example, the locations, suchas locations 130, 132, and 134, may be determined by transforming avirtual screen of pixels (e.g., from a z-buffer) into world-space. Thevirtual screen may be representative of a view of a camera in thevirtual environment 110 and the locations may, in some embodiments, bereferred to as pixels, or world-space pixels. In other examples,locations may not have such a one-to-one correspondence with pixels.Further, in other examples, the locations may be determined asrespective points and/or areas at which respective eye-rays (e.g., castfrom a camera through a virtual screen) interact with the virtualenvironment 110.

In various embodiments, the accuracy of a sample at a location may beenhanced by combining ray-traced samples from multiple rays, as each raymay only provide partial information. As such, using a limited number ofrays to sample the virtual environment 110 may tend to cause visualartifacts in images rendered by the image renderer 102, particularly forcertain locations in the virtual environment 110. To illustrate anexample of the forgoing, the rays used in the example shown are shadowrays used to sample one or more aspects of lighting conditions at thelocations with respect to a light source 120 in the virtual environment110. The image renderer 102 may use this information, for example, torender shadows in an image based on the lighting conditions at thelocations. In some embodiments, rays are cast from locations to sample arandom, or pseudo-random, position at the light source 120. The imagerenderer 102 may use any suitable approach for ray tracing, such asstochastic ray tracing Examples of stochastic ray tracing techniquesthat may be used include those that employ Monte Carlo or quasi-MonteCarlo sampling strategies. In the example shown, the ray tracer 104casts one ray per location and/or pixel in the ray tracing pass 114 forsampling. In other embodiments a different quantity of rays may be castper location or pixel, no rays may be cast for certain locations orpixels, and/or different amounts of rays may be cast for differentlocations or pixels.

While only the light source 120 is shown, the lighting conditions atlocations may similarly be sampled with respect to other light sourcesand/or objects in the virtual environment 110, which may be combinedwith the ray-traced samples derived with respect to the light source120. While shadow rendering is the primarily example described, it iscontemplated that disclosed techniques may be used for any of a varietyof ray tracing effects, such as reflections, global illuminations, andthe like. In such examples, the one or more aspects of the virtualenvironment that are sampled may be adapted to suit the effect(s) beingsimulated. Further, in the present examples, when a ray interacts with alocation in the virtual environment 110 (e.g., at the light source 120or an occluder 122), no additional ray may be cast from that location.However, for other ray tracing effects or techniques, one or moreadditional rays may be cast therefrom.

As shown, some of the rays, such as the ray 144, the ray 148, and theray 152, may interact with the light source 120 resulting in ray-tracedsamples indicating light from the light source 120 may illuminatecorresponding locations. Other rays, such as the ray 142, the ray 140,the ray 146, and the ray 150, may interact with an object resulting inray-traced samples indicating light from the light source 120 is atleast partially blocked and/or prevented from reaching the locations. Anexample of such an object is the occluder 122, which may block the raysfrom reaching the light source 120. The location 130 is an example of alocation that may be within a penumbra of a shadow cast by the occluder122, and the lighting conditions may be more accurately computed by theimage renderer 102 combining the ray-traced samples derived frommultiple rays. For example, a ray-traced sample of the location 130generated using only the ray 142 may indicate that the location 130 iscompletely blocked from receiving light from the light source 120.However, a ray-traced sample of the location 130 generated using the ray148 indicates that the location 130 is at least partially illuminated bythe light source 120.

Limiting the number of rays used to generate samples for locations maytherefore cause noise resulting in visual artifacts in images renderedby the image renderer 102. While denoising techniques may be used toreduce the noise and prevalence of visual artifacts, visual artifactsmay still be present in the rendered images. As an example, aliasing maybe present in high frequency areas of an image that include sharp orfine details. This may occur where the occluder 122 includes finegrating, bicycle spokes, dense foliage, blades of grass, leaves, and thelike. In such examples, shadow regions (e.g., at penu s) resulting fromthe occluder 122 may tend to cause visual artifacts that are difficultto prevent through denoising, particularly for low sample counts, suchas one sample per pixel. These artifacts may be especially pronouncedunder certain circumstances, such as where the occluder 122 is adjacentto the locations being sampled.

The image renderer 102 may employ the casting determiner 108 to adaptthe number of rays used to sample particular locations to various sceneconditions, thereby reducing the likelihood of such visual artifactswhile avoiding an increase to the number of rays used to sample everylocation in the scene. In particular, the criteria employed by thecasting determiner 108 to determine the number of rays may be tailoredto certain problematic locations and scene conditions used for a raytracing effect. For example, FIG. 1 indicates that the ray tracing pass114 in combination with the ray tracing pass 116 uses a variable numberof rays to sample the lighting conditions for different locations withrespect to the light source 120. By way of example and not limitation,three rays are used for the location 130, two rays are used for otherlocations—such as the locations 132 and 134—and only one ray is used forother locations.

The casting determiner 108 may determine for a given location(s) whetherto cast one or more additional rays to sample the one or more aspects ofthe virtual environment (e.g., lighting conditions) and/or how many raysto cast to sample the one or more aspects of the virtual environment forthe given location(s). The determinations made by the casting determiner108 may be based on the results of analysis performed by the sampleanalyzer 106.

In embodiments, the casting determiner 108 may make such determinationsfor each location and/or pixel being rendered (and/or selected groupsthereof). For example, the sample analyzer 106 may analyze results ofthe ray tracing pass 114 for each given location(s) and the castingdeterminer 108 may determine whether or not to cast one or moreadditional rays and/or how many additional rays to cast for the givenlocation(s) based on the analysis. These rays may be cast in the raytracing pass 116, and ray-traced samples from the ray tracing pass 116may be used to update the results of the ray tracing pass 114 (e.g., bycombining ray-traced samples for corresponding locations) to enhance theaccuracy of the overall sampling of the virtual environment 110.

The sample analyzer 106 may, for example, analyze variables such asvisibilities and/or hit distances of ray-traced samples of the lightsource 120 for related locations (and the location in some embodiments)in the virtual environment 110. More or different variables may beemployed in various embodiment, which may depend upon the ray tracingeffect being simulated. A visibility for a location, such as thelocation 130, may indicate whether the location is at least partiallyvisible to the light source 120. A hit distance for a location, such asthe location 130, may indicate a distance between the location and anobject, such as the occluder 122 or the light source 120.

In various examples, a ray-traced sample determined for a location, suchas the location 130, and for a ray, such as the ray 142, may include avisibility (e.g., visibility value) representative of whether the rayinteracted with the light source 120. For example, a visibility valuefor the ray 142 may be a binary value in which a “1” indicates the rayhit the light source 120 and a “0” indicates the ray did not hit thelight source 120. The ray-traced sample may also include a hit distance(e.g., hit distance value) representative of a hit distance between thelocation and the point at which the ray interacted with an object. Forexample, a hit distance value for the ray 142 may be a value thatindicates a magnitude of the hit distance, where a larger value mayindicate a greater distance than a smaller value (e.g., on a linearscale).

In various embodiments, visibilities and/or hit distances (and/or othervariables) for locations in a region around the location (e.g., centeredat the region) may be analyzed (e.g., within an N-by-N kernel centeredat the location) to make the determination(s). For example, to make adetermination for a given location and/or pixel, the region for thatlocation and/or pixel may be analyzed. FIG. 2A-2D each showrepresentations of different example combinations of visibilities andhit distances for a region and are used to describe how such differencesmay impact the determinations made by the casting determiner 108 forthat region.

In the examples shown, the region includes locations 210, 212, 214, 216,218, 220, 222, 224, and 226. Each location may, for example, correspondto a respective location in FIG. 1. However, the visibilities and hitdistances in FIG. 2A-2D are not intended to necessarily match thedepiction of FIG. 1 for particular locations. In embodiments, the sampleanalyzer 106 may analyze a group of the visibilities and the hitdistances that correspond to a group of the locations based onproximities of the locations in the group to a given location(s). Thecasting determiner 108 may then make a determination for that givenlocation(s). For example, for the location 130, the casting determiner108 may define an N-by-N kernel centered at the location 130. In thisexample, the location 130 may correspond to the location 210 in FIGS.2A-2D, and the N-by-N kernel may be a 3×3 kernel. The sample analyzer106 then analyze one or more of the visibilities and/or hit distancesthat correspond to the locations within that region. The castingdeterminer 108 may use the results of the analysis for that region todetermine whether to cast one or more additional rays to sample the oneor more aspects of the virtual environment 110 (e.g., lightingconditions) and/or how many rays to cast to sample the one or moreaspects of the virtual environment 110 for the location 130.

A similar approach may be used for each given location(s) and/or pixels.For example, the number of regions may, in some embodiments, match thenumber of pixels being rendered. Further, analysis of the regions may beperformed in parallel, such as by a GPU. In some embodiments, theanalysis performed by the sample analyzer 106 and/or the determinationsmade by the casting determiner 108 may at least partially beincorporated into the subsequent ray tracing pass (e.g., incorresponding executions of a dispatch ray function), such as the raytracing pass 116. As further examples, the analysis performed by thesample analyzer 106 and/or the determinations made by the castingdeterminer 108 may at least partially be incorporated into one or moreshaders between a subsequent ray tracing pass, such as the ray tracingpass 116. For example, a pixel shader and/or compute shader may be usedfor at least some of the computations.

In some examples, the group of visibilities and/or hit distances may bedetermined and/or defined using a different approach. Further, the shapeof the kernel may not necessarily be square and/or the size of thekernel may be varied. In some examples, the size of the kernel may bedetermined based at least in part on a resolution of the virtualenvironment being rendered. For example, a 3-by-3 kernel may be used fora 4K resolution, a larger size, such as 5-by-5, may be used for a lowerresolution, such as 640×480, and a smaller kernel may be used for ahigher resolution (e.g., 2-by-2). It is also noted that the region maynot be contiguous, may not include the given location(s) and/or may notinclude multiple locations in various embodiments.

Examples of factors used to make the determination(s) for the location210 of FIGS. 2A-2D include those based on the variability in thevisibilities and/or hit distances within the region. Additional examplesof factors include those based on differences between one or more of thevisibilities and/or hit distances relative to the location 210 and/orthe overall region. Further examples of factors include those based onthe magnitude of one or more of the hit distances (and/or visibilitiesin some embodiments).

Referring now to FIG. 2A, FIG. 2A is a diagram illustrating an exampleof ray-traced samples for a region in a virtual environment that hasfull visibility with respect to a light source, in accordance with someembodiments of the present disclosure. For example, the white shading ofvisibilities 200A in FIG. 2A may indicate that each of the locations210, 212, 214, 216, 218, 220, 222, 224, and 226 has full visibility withrespect to the light source 120 in FIG. 1. In this case, the rays castfrom those locations may each have hit the light source 120 in the raytracing pass 114. In this example, the sample analyzer 106 may analyzethe visibilities 200A and based on the analysis, the casting determiner108 may determine to not cast any additional rays for the location 210.Such an analysis may be based on determining the visibilities 200A inthe group do not have at least a threshold amount of variability. Forexample, the sample analyzer 106 may determine whether at least one ofthe visibility values corresponding to the visibilities 200A isdifferent than at least one other of the visibility values. If thisthreshold amount of variability is met, the casting determiner 108 maydetermine to cast at least one additional ray for the location 210.Otherwise, no additional ray may be cast for the location 210 (e.g.,regardless of hit distances 202A for the region). In other examples, amore complex analysis and/or different threshold amount of variabilitymay be employed.

Referring now to FIG. 2B, FIG. 2B is a diagram illustrating an exampleof ray-traced samples for a region in a virtual environment that has novisibility with respect to a light source, in accordance with someembodiments of the present disclosure. For example, the dark shading ofvisibilities 200B in FIG. 2B may indicate that each of the locations210, 212, 214, 216, 218, 220, 222, 224, and 226 has no visibility withrespect to the light source 120 in FIG. 1. In this case, the rays castfrom those locations may each have hit the occluder 122 and/or otherobject instead of the light source 120 in the ray tracing pass 114. Inthis example, the sample analyzer 106 may analyze the visibilities 200Band based on the analysis, the casting determiner 108 may also determineto not cast any additional rays for the location 210. As in FIG. 2A,such an analysis may be based on determining the visibilities 200B inthe group do not have at least a threshold amount of variability. Forexample, the sample analyzer 106 may determine whether at least one ofthe visibility values corresponding to the visibilities 200B isdifferent than at least one other of the visibility values. If thisthreshold amount of variability is met, the casting determiner 108 maydetermine to cast at least one additional ray for the location 210.Otherwise, no additional ray may be cast for the location 210 (e.g.,regardless of hit distances 202B for the region).

Referring now to FIG. 2C, FIG. 2C is a diagram illustrating an exampleof ray-traced samples for a region in a virtual environment that hasmixed visibility and high hit distances with respect to a light source,in accordance with some embodiments of the present disclosure. Forexample, the white shading of visibilities 200C in FIG. 2C may indicatethat each of the locations 222, 224, and 226 has full visibility withrespect to the light source 120 in FIG. 1 and the dark shading ofvisibilities 200C in FIG. 2C may indicate that each of the locations210, 212, 214, 216, 218, and 220 has no visibility with respect to thelight source 120 in FIG. 1.

In this example, the sample analyzer 106 may analyze the visibilities200C and based on the analysis, the casting determiner 108 may determineto cast at least one additional ray for the location 210 (e.g., oneadditional ray). Such an analysis may be based on determining thevisibilities 200C in the group do have at least a threshold amount ofvariability. For example, the sample analyzer 106 may determine whetherat least one of the visibility values corresponding to the visibilities200C is different than at least one other of the visibility values. Ifthis threshold amount of variability is met (as it is in FIG. 2C), thecasting determiner 108 may determine to cast at least one additional rayfor the location 210. As with FIGS. 2A and 2B, in other examples, a morecomplex analysis and/or different threshold amount of variability may beemployed.

With regard to hit distances, the dark shading of hit distances 202C inFIG. 2C may indicate that each of the locations 210, 212, 214, 216, 218,and 220 has a relatively high hit distance with respect to an occluder.The white shading of the hit distances 202C in FIG. 2C may indicate thateach of the locations 222, 224, and 226 has a relatively low hitdistance with respect to an occluder (e.g., a minimum hit distance valueas those rays did not hit an occluder). For example, the sample analyzer106 may analyze the hit distances 202C and based on the analysis, thecasting determiner 108 may determine not to cast at least one additionalray for the location 210 (e.g., in addition to the ray that will be castbased on the visibility).

Such an analysis may be based on determining the hit distances 202C inthe group do not have at least a threshold amount of variability. Insome embodiments, the sample analyzer 106 may determine the thresholdamount of variability of the hit distances 202C with respect to a hitdistance of the location 210. This may involve the sample analyzer 106comparing the hit distances of the location 210 to the hit distances forthe other location(s), such as to determine whether one or more of thelocation(s) are within a delta (threshold amount) of one another (e.g.,sufficiently similar). In some examples, if one or more of the locationsare not sufficiently similar (e.g., at least one location exceeds thedelta) the casting determiner 108 may cast an additional ray. However,if each of the one or more of the locations are sufficiently similar(e.g., no location exceeds the delta) the casting determiner 108 may notcast an additional ray, as in FIG. 2C. In this example, the similaritiesmay be considered with respect to those rays that also hit an occluder,which may not meet this criteria for an additional ray.

In addition to (or alternatively from) the casting determiner 108 basingdeterminations on whether the threshold amount of variability of the hitdistances 202C with respect to a hit distance of the location 210 ismet, the determination(s) may be based at least in part on determiningat least one of the hit distances 202C in the group is less than athreshold value. For example, the sample analyzer 106 may analyze thehit distances for each of the locations of the region. If there are nohit distances for the locations that are below the threshold value(indicating a close hit or short hit distance), the casting determiner108 may determine not to cast an additional ray for the location 210(e.g., although a ray may still be cast based on a differentdetermination). Otherwise if at least one of the hit distances are belowthe threshold value, the casting determiner 108 may determine to castone or more additional rays (e.g., a single additional ray) for thelocation 210. As most of the hit distances are quite high in FIG. 2C,the casting determiner 108 may determine not to cast an additional raybased on the hit distances 202C.

Referring now to FIG. 2D, FIG. 2D is a diagram illustrating an exampleof ray-traced samples for a region in a virtual environment that hasmixed visibility and includes low hit distances with respect to a lightsource, in accordance with some embodiments of the present disclosure.For example, the white shading of visibilities 200D in FIG. 2D mayindicate that each of the locations 212, 218, 216, and 226 has fullvisibility with respect to the light source 120 in FIG. 1, and the darkshading of visibilities 200D in FIG. 2D may indicate that each of thelocations 210, 214, 220, 222, and 224 has no visibility with respect tothe light source 120 in FIG. 1.

As in FIG. 2C, the sample analyzer 106 may analyze the visibilities 200Dand based on the analysis, the casting determiner 108 may determine tocast at least one additional ray for the location 210. Such an analysismay be based on determining the visibilities 200D in the group do haveat least a threshold amount of variability. For example, the sampleanalyzer 106 may determine whether at least one of the visibility valuescorresponding to the visibilities 200D is different than at least oneother of the visibility values. If this threshold amount of variabilityis met (as it is in FIG. 2D), the casting determiner 108 may determineto cast at least one additional ray for the location 210.

With regard to hit distances, dark shading of hit distances 202D in FIG.2D may indicate larger hit distances than smaller hit distances. Forexample, the location 224 may have the largest hit distance, followed bythe locations 210 and 210, then the locations 214 and 222. The whiteshading of the hit distances 202D in FIG. 2D may indicate that each ofthe locations 212, 218, 216, and 226 has a relatively low hit distancewith respect to an occluder (e.g., a minimum hit distance value as thoserays did not hit an occluder). For example, the sample analyzer 106 mayanalyze the hit distances 202D and based on the analysis, the castingdeterminer 108 may determine to cast at least one additional ray for thelocation 210 (e.g., in addition to the ray that will be cast based onthe visibility).

Similar to FIG. 2C, such an analysis may be based on determining the hitdistances 202D in the group do have at least a threshold amount ofvariability. In some embodiments, the sample analyzer 106 may determinethe threshold amount of variability of the hit distances 202D withrespect to a hit distance of the location 210. This may involve thesample analyzer 106 comparing the hit distances of the location 210 tothe hit distances for the other location(s), such as to determinewhether one or more of the location(s) are within a delta (thresholdamount) of one another (e.g., sufficiently similar). In some examples,if one or more of the locations are not sufficiently similar (e.g., atleast one location exceeds the delta) the casting determiner 108 maycast an additional ray. However, if each of the one or more of thelocations are sufficiently similar (e.g., no location exceeds the delta)the casting determiner 108 may not cast an additional ray, as in FIG.2C. In this example, the similarities may be considered with respect tothose rays that also hit an occluder, which may meet this criteria foran additional ray.

In addition to (or alternatively from) the casting determiner 108 basingdeterminations on whether the threshold amount of variability of the hitdistances 202D with respect to a hit distance of the location 210 ismet, the determination(s) may be based at least in part on determiningat least one of the hit distances 202D in the group is less than athreshold value. For example, the sample analyzer 106 may analyze thehit distances for each of the locations of the region. If there are nohit distances for the locations that are below the threshold value(indicating a close hit or short hit distance), the casting determiner108 may determine not to cast an additional ray for the location 210(e.g., although a ray may still be cast based on a differentdetermination). Otherwise if at least one of the hit distances are belowthe threshold value, the casting determiner 108 may determine to castone or more additional rays (e.g., a single additional ray) for thelocation 210. In FIG. 2D, the locations 214 and 222 may have hitdistances that meet this criteria so that the casting determiner 108 maydetermine not to cast an additional ray based on the hit distances 202D.

While FIG. 2A-2D are used to describe various examples of how the sampleanalyzer 106 may analyze groups of visibilities and/or hit distances andhow the casting determiner 108 may determine whether to cast one or moreadditional rays for locations and/or how many additional rays to cast,these approaches may be varied. For example, visibilities and hitdistances may be evaluated separately and/or in combination in order forthe casting determiner 108 to make one or more determinations. In someexamples, criteria for casting a ray based on visibility may be analyzedand if the visibility criteria is not met, hit distance criteria may notbe analyzed by the sample analyzer 106, thereby preserving computingresources (e.g., the visibility criteria being met may be one of thecriteria for the hit distance criteria to be met). In other examples,hit distance criteria may still be evaluated.

Additionally, in some examples, the number of rays cast for a givenlocation(s) may be a function of the visibility and/or hit distances.For example, the number of rays could scale with visibility variabilityand/or other factors. As a further example, the number of rays couldscale with hit distance variability and/or other factors, such as thehit distances that are below the delta with respect to the locationand/or the number of hit distances that are below threshold value. Also,other factors may be considered, such as the type of object hit by rays,temporal information, etc. For example, while the present examples mayemploy spatial samples for hit distances and/or visibility, temporal hitdistances and/or visibility values may be used in addition to or insteadof the spatial values.

Further, in the examples of FIG. 2A-2D visibilities have binary values(e.g., hit or miss). This may be a result of one ray being cast perpixel and/or location in the ray tracing pass 114. Where additional raysare cast per pixel and/or location, visibility values may be non-binary.For example, a visibility value for a location may be an average ofvisibility values for the rays cast from the location. This may impactthe way the sample analyzer 106 evaluates variability and/or otherfactors regarding visibility. In some examples, a hit distance value fora location may be the lowest of hit distance values for the rays castfrom the location (the shortest hit distance). This may also impact theway the sample analyzer 106 evaluates variability, threshold values,and/or other factors regarding hit distance.

As described herein, the ray tracer 104 may cast one or more additionalrays or no additional rays for one or more locations and/or pixels, asdescribed by the casting determiner 108. These additional rays may becast over any number of additional ray tracing passes, such as in theray tracing pass 116. Ray-tracing samples of a location from multiplerays and ray tracing passes may be combined to form an aggregatedray-tracing sample. In some examples, a visibility value for a locationmay be an average of visibility values for the rays cast from thelocation over the ray tracing passes. Also, a hit distance value for thelocation may be the lowest of hit distance values for the rays cast fromthe location over the ray tracing passes. The image renderer 102 may usethe resultant ray-tracing samples to generate one or more images thatare representative of the virtual environment 110 and/or one or moreportions thereof (e.g., representative of a camera or other view of thevirtual environment 110).

Now referring to FIGS. 3-6, each block of methods 300, 400, 500, and600, and other methods described herein, comprises a computing processthat may be performed using any combination of hardware, firmware,and/or software. For instance, various functions may be carried out by aprocessor executing instructions stored in memory. The methods may alsobe embodied as computer-usable instructions stored on computer storagemedia. The methods may be provided by a standalone application, aservice or hosted service (standalone or in combination with anotherhosted service), or a plug-in to another product, to name a few. Inaddition, the methods are described, by way of example, with respect tothe adaptive ray tracing system 100 (FIG. 1). However, these methods mayadditionally or alternatively be executed by any one system, or anycombination of systems, including, but not limited to, those describedherein.

FIG. 3 is a flow diagram showing the method 300 for determining whetherto cast one or more additional rays to cast to sample lightingconditions for a pixel, in accordance with some embodiments of thepresent disclosure. The method 300 may apply to any of the examples ofFIGS. 2A-2D, or other examples. The method 300, at block B302, includesdetermining visibilities and hit distances for pixels using rays. Forexample, the ray tracer 104 of FIG. 1 may determine (e.g., in the raytracing pass 114) for pixels (e.g., corresponding to at least thelocations shown in FIG. 1), visibilities and hit distances with respectto the light source 120 using at least one shadow ray for each pixel tosample lighting conditions of the pixel with respect to the light source120. The visibilities and the hit distances may have been determinedbased on sampling lighting conditions in a scene comprising one or morepixels using at least one shadow ray for each pixel of the one or morepixels.

The method 300, at block B304, includes selecting a group of thevisibilities and the hit distances based on a proximity from a givenpixel(s). For example, the sample analyzer 106 may analyze a group ofthe visibilities and the hit distances that are associated with a groupof the pixels corresponding to the locations of FIGS. 2A-2D based ondistances of the pixels in the group from a given pixel (e.g.,corresponding to the location 210) of the pixels.

The method 300, at block B306, includes determining to cast one or moreadditional rays for the given pixel(s). For example, based on theanalyzing, the casting determiner 108 may determine to cast one or moreadditional shadow rays to sample the lighting conditions of the givenpixel (e.g., corresponding to the location 210) with respect to thelight source 120.

The method 300, at block B308, includes updating lighting conditions ofthe given pixel using the one or more additional rays. For example, theray tracer 104 may cast the one or more additional rays in the raytracing pass 116 and update the lighting conditions for the given pixelbased at least in part on the one or more additional rays (e.g., bydetermining an aggregated ray-traced sample for the pixel).

The method 300, at block B310, includes rendering an image using thelighting conditions. For example, the image renderer 102 may render animage representative of at least a portion of the virtual environment110 using the lighting conditions of the given pixel (e.g., andsimilarly for each pixel of a virtual screen).

FIG. 4 is a flow diagram showing the method 400 for determining aquantity of rays to cast to sample lighting conditions for a location ina virtual environment, in accordance with some embodiments of thepresent disclosure. The method 400 may apply to the examples of any ofFIGS. 2A-2D, or other examples. The method 400, at block B402, includessampling lighting conditions of locations using rays. For example, theray tracer 104 of FIG. 1 may cast (e.g., in the ray tracing pass 114)rays from locations in the virtual environment 110 (e.g., correspondingto at least the locations shown in FIG. 1) towards the light source 120in the virtual environment 110 to sample lighting conditions of thelocations with respect to the light source 120.

The method 400, at block B404, includes determining ray-traced samplesof the locations. For example, the ray tracer 104 may determine based onthe rays, ray-traced samples comprising visibilities and hit distancesof the locations with respect to the light source 120.

The method 400, at block B406, includes analyzing a group of theray-traced samples based on proximities of locations to a givenlocations(s). For example, the sample analyzer 106 may analyze a groupof the visibilities and the hit distances that correspond to a group ofthe locations 210-226 in FIGS. 2A-2D based on proximities of thelocations in the group to the location 210.

The method 400, at block B408, includes determining a quantity of ray tocast from the given location(s) to produce one or more ray-tracedsamples. For example, the casting determiner 108 may, based on theanalyzing, determine a quantity of rays to cast from the location 210toward the light source 120 to produce one or more ray-traced samplesfor the location 210.

The method 400, at block B410, includes computing lighting conditions ofthe given location(s) using the one or more ray-traced samples. Forexample, the ray tracer 104 may cast the one or more additional rays inthe ray tracing pass 116 and compute the lighting conditions of thelocation 210 based at least in part on the one or more additional rays(e.g., by determining an aggregated ray-traced sample for the location210).

The method 400, at block B412, includes rendering at least a portion ofthe virtual environment using the lighting conditions of the givenlocation(s). For example, the image renderer 102 may render an imagerepresentative of at least a portion of the virtual environment 110using the lighting conditions of the location 210 (e.g., and similarlyfor other locations of the virtual environment 110).

FIG. 5 is a flow diagram showing the method 500 for determining whetherto cast one or more additional rays to sample lighting conditions for alocation in a virtual environment, in accordance with some embodimentsof the present disclosure. The method 500 may apply to the examples ofany of FIGS. 2A-2D, or other examples. The method 500, at block B502,includes determining visibilities for locations using rays. For example,the ray tracer 104 of FIG. 1 may determine (e.g., in the ray tracingpass 114) for locations (e.g., corresponding to at least the locationsshown in FIG. 1), visibilities with respect to the light source 120using at least one shadow ray for each location to sample lightingconditions of the location with respect to the light source 120.

The method 500, at block B504, includes analyzing a group of thevisibilities associated with a region surrounding a given location(s).For example, the sample analyzer 106 may analyze, for the location 210of the locations, a group of the visibilities associated with a regionsurrounding the location 210 in the virtual environment 110. This regionmay correspond to the locations of FIGS. 2A-2D.

The method 500, at block B506, includes determining to cast one or moreadditional rays for the given location(s). For example, based on theanalyzing, the casting determiner 108 may determine to cast one or moreadditional shadow rays from the location 210 to sample the lightingconditions of the location 210 with respect to the light source 120.

The method 500, at block B508, includes computing lighting conditions ofthe given location using the one or more additional rays. For example,the ray tracer 104 may cast the one or more additional rays in the raytracing pass 116 and determine the lighting conditions of the location210 based at least in part on the one or more additional rays (e.g., bydetermining an aggregated ray-traced sample for the location 210).

The method 500, at block B510, includes rendering at least a portion ofthe virtual environment using the lighting conditions of the givenlocation(s). For example, the image renderer 102 may render an imagerepresentative of at least a portion of the virtual environment 110using the lighting conditions of the location 210 (e.g., and similarlyfor other locations of the virtual environment 110).

FIG. 6 is a flow diagram showing the method 600 including a decisiontree for determining a quantity of rays cast to sample lightingconditions for a location in a virtual environment, in accordance withsome embodiments of the present disclosure. The method 600 may apply tothe examples of any of FIGS. 2A-2D, or other examples. The method 600,at block B602, includes determining ray-traced samples for locations.For example, the ray tracer 104 of FIG. 1 may determine (e.g., in theray tracing pass 114) for locations (e.g., corresponding to at least thelocations shown in FIG. 1), ray-traced samples using at least one shadowray for each location to sample lighting conditions of the location withrespect to the light source 120.

The method 600, at block B604, includes determining, for a givenlocation(s), whether visibility criteria for the location(s) issatisfied. For example, the casting determiner 108 may use the sampleanalyzer 106 to analyze the visibilities of the locations 210-226 todetermine whether visibility criteria for the location 210 is satisfied.If the visibility criteria is not satisfied for the given location(s),the method may proceed to block B606, where the casting determiner 108determines to not cast any additional rays for the given location(s).FIGS. 2A and 2B may correspond to examples of this scenario. If thevisibility criteria is satisfied for the given location(s), the methodmay proceed to block B608.

The method 600, at block B608, includes determining, for the givenlocation(s), whether hit distance criteria for the location(s) issatisfied. For example, the casting determiner 108 may use the sampleanalyzer 106 to analyze the hit distances of the locations 210-226 todetermine whether hit distance criteria for the location 210 issatisfied. If the hit distance criteria is not satisfied for the givenlocation(s), the method may proceed to block B610, where the castingdeterminer 108 determines to cast one or more first additional rays forthe given location(s). FIG. 2C may correspond to an example of thisscenario. If the hit distance criteria is satisfied for the givenlocation(s), the method may proceed to block B612, where the castingdeterminer 108 determines to cast one or more first additional rays(e.g., one ray) for the given location(s) and one or more secondadditional rays (e.g., one ray) for the given location(s). FIG. 2D maycorrespond to an example of this scenario.

FIG. 7 is a block diagram of an example computing device 700 suitablefor use in implementing some embodiments of the present disclosure.Computing device 700 may include an interconnect system 702 thatdirectly or indirectly couples at least the following devices: memory704, one or more central processing units (CPUs) 706, one or moregraphics processing units (GPUs) 708, a communication interface 710,input/output (I/O) ports 712, input/output components 714, a powersupply 716, and one or more presentation components 718 (e.g.,display(s)). The adaptive ray tracing system 100 of FIG. 1 may beimplemented on one or more of the GPU(s) 708 and/or the CPU(s) 706 ofthe computing device 700. Further, various memory described herein maycorrespond to the memory 704 and/or one or more instantiations of thecomputing device 700.

Although the various blocks of FIG. 7 are shown as connected via theinterconnect system 702 with lines, this is not intended to be limitingand is for clarity only. For example, in some embodiments, apresentation component 718, such as a display device, may be consideredan I/O component 714 (e.g., if the display is a touch screen). Asanother example, the CPUs 706 and/or GPUs 708 may include memory (e.g.,the memory 704 may be representative of a storage device in addition tothe memory of the GPUs 708, the CPUs 706, and/or other components). Inother words, the computing device of FIG. 7 is merely illustrative.Distinction is not made between such categories as “workstation,”“server,” “laptop,” “desktop,” “tablet,” “client device,” “mobiledevice,” “hand-held device,” “game console,” “electronic control unit(ECU),” “virtual reality system,” and/or other device or system types,as all are contemplated within the scope of the computing device of FIG.7.

The interconnect system 702 may represent one or more links or busses,such as an address bus, a data bus, a control bus, or a combinationthereof. The interconnect system 702 may include one or more bus or linktypes, such as an industry standard architecture (ISA) bus, an extendedindustry standard architecture (EISA) bus, a video electronics standardsassociation (VESA) bus, a peripheral component interconnect (PCI) bus, aperipheral component interconnect express (PCIe) bus, and/or anothertype of bus or link. In some embodiments, there are direct connectionsbetween components. As an example, the CPU 706 may be directly connectedto the memory 704. Further, the CPU 706 may be directly connected to theGPU 708. Where there is direct, or point-to-point connection betweencomponents, the interconnect system 702 may include a PCIe link to carryout the connection. In these examples, a PCI bus need not be included inthe computing device 700.

The memory 704 may include any of a variety of computer-readable media.The computer-readable media may be any available media that may beaccessed by the computing device 700. The computer-readable media mayinclude both volatile and nonvolatile media, and removable andnon-removable media. By way of example, and not limitation, thecomputer-readable media may comprise computer-storage media andcommunication media.

The computer-storage media may include both volatile and nonvolatilemedia and/or removable and non-removable media implemented in any methodor technology for storage of information such as computer-readableinstructions, data structures, program modules, and/or other data types.For example, the memory 704 may store computer-readable instructions(e.g., that represent a program(s) and/or a program element(s), such asan operating system. Computer-storage media may include, but is notlimited to, RAM, ROM, EEPROM, flash memory or other memory technology,CD-ROM, digital versatile disks (DVD) or other optical disk storage,magnetic cassettes, magnetic tape, magnetic disk storage or othermagnetic storage devices, or any other medium which may be used to storethe desired information and which may be accessed by computing device700. As used herein, computer storage media does not comprise signalsper se.

The computer storage media may embody computer-readable instructions,data structures, program modules, and/or other data types in a modulateddata signal such as a carrier wave or other transport mechanism andincludes any information delivery media. The term “modulated datasignal” may refer to a signal that has one or more of itscharacteristics set or changed in such a manner as to encode informationin the signal. By way of example, and not limitation, the computerstorage media may include wired media such as a wired network ordirect-wired connection, and wireless media such as acoustic, RF,infrared and other wireless media. Combinations of any of the aboveshould also be included within the scope of computer-readable media.

The CPU(s) 706 may be configured to execute the computer-readableinstructions to control one or more components of the computing device700 to perform one or more of the methods and/or processes describedherein. The CPU(s) 706 may each include one or more cores (e.g., one,two, four, eight, twenty-eight, seventy-two, etc.) that are capable ofhandling a multitude of software threads simultaneously. The CPU(s) 706may include any type of processor, and may include different types ofprocessors depending on the type of computing device 700 implemented(e.g., processors with fewer cores for mobile devices and processorswith more cores for servers). For example, depending on the type ofcomputing device 700, the processor may be an Advanced RISC Machines(ARM) processor implemented using Reduced Instruction Set Computing(RISC) or an x86 processor implemented using Complex Instruction SetComputing (CISC). The computing device 700 may include one or more CPUs706 in addition to one or more microprocessors or supplementaryco-processors, such as math co-processors.

The GPU(s) 708 may be used by the computing device 700 to rendergraphics (e.g., 3D graphics) or performed general purpose computations.For example, the GPU(s) 708 may be used for General-Purpose computing onGPUs (GPGPU). The GPU(s) 708 may include hundreds or thousands of coresthat are capable of handling hundreds or thousands of software threadssimultaneously. The GPU(s) 708 may generate pixel data for output imagesin response to rendering commands (e.g., rendering commands from theCPU(s) 706 received via a host interface). The GPU(s) 708 may includegraphics memory, such as display memory, for storing pixel data or anyother suitable data, such as GPGPU data. The display memory may beincluded as part of the memory 704. The GPU(s) 708 may include two ormore GPUs operating in parallel (e.g., via a link). The link maydirectly connect the GPUs (e.g., using NVLINK) or may connect the GPUsthrough a switch (e.g., using NVSwitch). When combined together, eachGPU 708 may generate pixel data or GPGPU data for different portions ofan output or for different outputs (e.g., a first GPU for a first imageand a second GPU for a second image). Each GPU may include its ownmemory, or may share memory with other GPUs. In some embodiments, theGPU(s) 708 may perform all of the computations of methods describedwherein and/or any portion thereof. For example, analysis performed bythe sample analyzer 106 may be performed in parallel by the GPU(s) 708.Additionally ray tracing performed by the ray tracer 104 may beperformed in parallel by the GPU(s) 708. Further, determinations made bythe casting determiner 108 may be performed in parallel by the GPU(s)708.

The communication interface 710 may include one or more receivers,transmitters, and/or transceivers that enable the computing device 700to communicate with other computing devices via an electroniccommunication network, included wired and/or wireless communications.The communication interface 710 may include components and functionalityto enable communication over any of a number of different networks, suchas wireless networks (e.g., Wi-Fi, Z-Wave, Bluetooth, Bluetooth LE,ZigBee, etc.), wired networks (e.g., communicating over Ethernet orInfiniBand), low-power wide-area networks (e.g., LoRaWAN, SigFox, etc.),and/or the Internet.

The I/O ports 712 may enable the computing device 700 to be logicallycoupled to other devices including the I/O components 714, thepresentation component(s) 718, and/or other components, some of whichmay be built in to (e.g., integrated in) the computing device 700.Illustrative I/O components 714 include a microphone, mouse, keyboard,joystick, game pad, game controller, satellite dish, scanner, printer,wireless device, etc. The I/O components 714 may provide a natural userinterface (NUI) that processes air gestures, voice, or otherphysiological inputs generated by a user. In some instances, inputs maybe transmitted to an appropriate network element for further processing.An NUI may implement any combination of speech recognition, stylusrecognition, facial recognition, biometric recognition, gesturerecognition both on screen and adjacent to the screen, air gestures,head and eye tracking, and touch recognition (as described in moredetail below) associated with a display of the computing device 700. Thecomputing device 700 may be include depth cameras, such as stereoscopiccamera systems, infrared camera systems, RGB camera systems, touchscreentechnology, and combinations of these, for gesture detection andrecognition. Additionally, the computing device 700 may includeaccelerometers or gyroscopes (e.g., as part of an inertia measurementunit (IMU)) that enable detection of motion. In some examples, theoutput of the accelerometers or gyroscopes may be used by the computingdevice 700 to render immersive augmented reality or virtual reality.

The power supply 716 may include a hard-wired power supply, a batterypower supply, or a combination thereof. The power supply 716 may providepower to the computing device 700 to enable the components of thecomputing device 700 to operate.

The presentation component(s) 718 may include a display (e.g., amonitor, a touch screen, a television screen, a heads-up-display (HUD),other display types, or a combination thereof), speakers, and/or otherpresentation components. The presentation component(s) 718 may receivedata from other components (e.g., the GPU(s) 708, the CPU(s) 706, etc.),and output the data (e.g., as an image, video, sound, etc.). Inaccordance with the present disclosure, any of the various imagesdescribed herein may be presented on the display using the presentationcomponent(s) 718.

The disclosure may be described in the general context of computer codeor machine-useable instructions, including computer-executableinstructions such as program modules, being executed by a computer orother machine, such as a personal data assistant or other handhelddevice. Generally, program modules including routines, programs,objects, components, data structures, etc., refer to code that performparticular tasks or implement particular abstract data types. Thedisclosure may be practiced in a variety of system configurations,including hand-held devices, consumer electronics, general-purposecomputers, more specialty computing devices, etc. The disclosure mayalso be practiced in distributed computing environments where tasks areperformed by remote-processing devices that are linked through acommunications network.

As used herein, a recitation of “and/or” with respect to two or moreelements should be interpreted to mean only one element, or acombination of elements. For example, “element A, element B, and/orelement C” may include only element A, only element B, only element C,element A and element B, element A and element C, element B and elementC, or elements A, B, and C. In addition, “at least one of element A orelement B” may include at least one of element A, at least one ofelement B, or at least one of element A and at least one of element B.

The subject matter of the present disclosure is described withspecificity herein to meet statutory requirements. However, thedescription itself is not intended to limit the scope of thisdisclosure. Rather, the inventors have contemplated that the claimedsubject matter might also be embodied in other ways, to includedifferent steps or combinations of steps similar to the ones describedin this document, in conjunction with other present or futuretechnologies. Moreover, although the terms “step” and/or “block” may beused herein to connote different elements of methods employed, the termsshould not be interpreted as implying any particular order among orbetween various steps herein disclosed unless and except when the orderof individual steps is explicitly described.

1. A computer-implemented method comprising: analyzing a group ofray-traced samples in a scene based at least on spatial proximities ofone or more locations in the scene to positions in the scenecorresponding to the group of ray-traced samples; based at least on theanalyzing, casting one or more rays from the one or more locations;determining based at least on the one or more rays, one or moreray-traced samples; computing one or more values of one or more aspectsof the scene using the one or more ray-traced samples; and rendering atleast a portion of the scene using the one or more values.
 2. The methodof claim 1, comprising determining a region around the one or morelocations, wherein the positions in the scene corresponding to the groupof ray-traced samples are disposed within the region.
 3. The method ofclaim 1, wherein the casting is based at least on determining a quantityof the one or more rays to cast based at least on the analyzing.
 4. Themethod of claim 1, wherein the casting is based at least on determiningto cast the one or more rays based at least on the analyzing.
 5. Themethod of claim 1, wherein the casting of the one or more rays is basedat least on determining values of a plurality of the ray-traced sampleshave at least a threshold amount of variability.
 6. The method of claim1, wherein the ray-traced samples indicate one or more of hit distancesand visibilities with respect to one or more objects in the scene. 7.The method of claim 1, wherein the casting of the one or more rays isbased at least on determining at least one value of at least oneray-traced sample of the group is less than a threshold value.
 8. Themethod of claim 1, wherein the ray-traced samples are determined usingat least a first ray tracing pass, and the one or more ray-tracedsamples are determined using at least a second ray tracing pass.
 9. Themethod of claim 1, wherein the one or more aspects correspond tolighting conditions of the scene and the one or more rays are cast fromthe one or more locations to one or more light sources to sample thelighting conditions.
 10. The method of claim 1, wherein each ray-tracedsample of the group of ray-traced samples corresponds to a respectivepixel of a virtual screen and the rendering is of at least a portion ofthe virtual screen.
 11. The method of claim 1, wherein a render of thescene generated using the rendering includes a graphical depiction ofone or more shadows, and wherein the casting of the one or more raysfrom the one or more locations is based at least on the group ofray-traced samples indicating the one or more locations are within oneor more penumbras corresponding to the one or more shadows graphicallydepicted in the render.
 12. A processor comprising: one or more circuitsto analyze a group of ray-traced samples corresponding to a group ofpixels of a scene based at least on proximities of the pixels in thegroup to one or more pixels in the scene, based at least on theanalyzing, cast one or more rays from one or more locations in thescene, the one or more locations associated with the one or more pixels,determine based at least on the one or more rays, one or more ray-tracedsamples, compute one or more values of the one or more aspects using theone or more ray-traced samples, and render at least a portion of thescene using the one or more values.
 13. The processor of claim 12,wherein the one or more circuits are to determine a region around theone or more pixels, wherein the group of pixels corresponds to theregion.
 14. The processor of claim 12, wherein the one or more pixelsare included in the group of pixels and at least one sample of theray-traced samples corresponds to the one or more pixels.
 15. Theprocessor of claim 12, wherein the casting is based at least ondetermining that one or more values of at least a first ray-tracedsample of the ray-traced samples is different than one or more values ofat least a second of the ray-traced samples.
 16. The processor of claim12, wherein the casting is based at least on determining one or morevalues of the ray-traced samples are within a threshold of one or morevalues associated with the one or more pixels.
 17. The processor ofclaim 12, wherein the one or more circuits are to: determine to includeat least a first ray in the one or more rays based at least on a firstanalysis of a first set of the ray-traced samples corresponding to afirst attribute of the scene; and determine to include at least a secondray in the one or more rays based at least on a second analysis of asecond set of the ray-traced samples corresponding to a second attributeof the scene.
 18. The processor of claim 12, wherein a render of thescene generated using the rendering includes a graphical depiction ofone or more shadows, and wherein the casting of the one or more raysfrom the one or more locations is based at least on the group ofray-traced samples indicating the one or more locations are within oneor more penumbras corresponding to the one or more shadows graphicallydepicted in the render.
 19. A system comprising: one or more processingunits; and one or more memory units storing instructions that, whenexecuted by the one or more processing units, cause the one or moreprocessing units to execute operations comprising: determining a regionin a scene based at least on one or more locations in the scene;analyzing a group of ray-traced samples that correspond to the region;based at least on the analyzing, casting one or more rays from the oneor more locations; determining based at least on the one or more rays,one or more ray-traced samples; computing one or more values of the oneor more aspects using the one or more ray-traced samples; and renderingat least a portion of the scene using the one or more values.
 20. Thesystem of claim 19, wherein the casting is based at least ondetermining, using the analyzing, whether one or more of visibilitycriterion or hit distance criterion of the region is satisfied.
 21. Thesystem of claim 19, wherein the one or more rays include one or moreshadow rays.
 22. The system of claim 19, wherein the casting is based atleast on determining a quantity of the one or more rays to cast based atleast on the analyzing.
 23. The processor of claim 19, wherein a renderof the scene generated using the rendering includes a graphicaldepiction of one or more shadows, and wherein the casting of the one ormore rays from the one or more locations is based at least on the groupof ray-traced samples indicating the one or more locations are withinone or more penumbras corresponding to the one or more shadowsgraphically depicted in the render.